<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/views/global/taglibs.jsp" %>
<div class="clearfix" style="height:40px"></div>
<form id="itemForm" class="form-inline validate" action="dev/backdoor/recharge" method="post">
	<div class="form-group">
		<label class="control-label">用户名: </label>
		<input type="text" name="loginName" required="用户名不能为空"/>
		<span class="error"></span>
		<label class="control-label">充值金额: </label>
		<input type="text" name="transValue" required="充值金额不能为空" number="true"/>
		<span class="error"></span>
		<input type="button" class="btn btn-success" value="充 值" onclick="doRecharge(this)"/>
	</div>
</form>
<div id="msg"></div>
<div class="btn-group">
</div>
<div class="clearfix" style="height:40px"></div>
<script type="text/javascript">
document.errorPlacement = function(error, element){
	error.appendTo( element.next() );
}

$(document).ready(function(){
	$("#btnFastdfsTransfer").click(function(){
		$.postEx("dev/backdoor/fastdfsTransfer", {}, function(jsonData){
			
		}, "json");
	});
});

function doRecharge(target){
	var form = $("#itemForm");
	var validator = $(form).validate({meta:"validate"});
	if(validator.form()){
        $(form).goAjax({semantic: false, checkLogin: true,
       		data:{},
       		success: function(jsonData) {
       			if(true == jsonData.success){
       				$("#msg").alert({type:'alert-success', text: '修改成功！'});
       			} else {
       				$("#msg").alert({type:'alert-danger', text: '修改失败: ' + jsonData.message});
       			}
       		}
       	});
	}
}
</script>
